package com.jiunuan.live.im.router.provider.rpc;

import com.jiunuan.live.im.dto.ImMsgBody;
import com.jiunuan.live.im.router.interfaces.rpc.ImRouterRpc;
import com.jiunuan.live.im.router.provider.service.ImRouterService;
import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.List;

/**
 * @Author: JiuNuan
 * @CreateTime: 2024-08-16 11:44
 * @Description:
 */
@DubboService
public class ImRouterRpcImpl implements ImRouterRpc {
    @Resource
    private ImRouterService imRouterService;

    /**
     * 按照用户id进行消息的发送
     * @param imMsgBody
     */
    @Override
    public boolean sendMsg(ImMsgBody imMsgBody) {
        return imRouterService.sendMsg(imMsgBody);
    }

    /**
     * 直播间内，批量发送消息
     *
     * @param imMsgBodyList
     */
    @Override
    public void batchSendMsg(List<ImMsgBody> imMsgBodyList) {
        imRouterService.batchSendMsg(imMsgBodyList);
    }
}
